const app = getApp();
Component({
  /**
   * 组件的一些选项
   */
  options: {
    addGlobalClass: true,
    multipleSlots: true
  },
  /**
   * 组件的对外属性
   */
  properties: {
    
    bgColor: {
      type: String,
      default: ''
    }, 
    //xue 加的
    CustomBack: {
      type: [Boolean, String],
      default: false
    },
    isCustom: {
      type: [Boolean, String],
      default: false
    },
    searchtext:{
      type: String,
      default: "搜索"
    },
    searchtype:{
      type: String,
      default: "pro"
    },

    isseach: {
      type: [Boolean, String],
      default: false
    },
    
    isBack: {
      type: [Boolean, String],
      default: false
    },
    bgImage: {
      type: String,
      default: ''
    },
    objmodel:{
      type:Object,
      default:{}
    }
  },
  /**
   * 组件的初始数据
   */
  data: {
    StatusBar: app.globalData.StatusBar,
    CustomBar: app.globalData.CustomBar,
    Custom: app.globalData.Custom,
    plen:1,
    seachfocus:false
  },
  /**
   * 组件的方法列表
   */

  ready() { 
    var $_pages = getCurrentPages();
    var plen = $_pages.length;
       this.setData({plen:plen})
   
    },
  methods: {
    seachSubmit(){

    },
    seachblur(){
      //失去焦点
      this.setData({seachfocus:false})
    },

    seachfocus(){
      //获取焦点
      this.setData({seachfocus:true})
    },
    BackPage() {    

     
      if(this.data.CustomBack){
       
        var myEventDetail = {} // detail对象，提供给事件监听函数
        var myEventOption = {} // 触发事件的选项
        this.triggerEvent("Backfunc", myEventDetail, myEventOption)
      }
      else
      {
        console.log(this.data.CustomBack)
        wx.navigateBack({
          delta: 1
        });
      }     
    },
    toHome(){
 

      wx.reLaunch({
        url: '/xc_lshop/index/index',
      })
    }
  }
})